package models

import (
	t "yikexing.com.cn/wyws/services/sqlstore/types"
)

type Vehicle struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
	Name           string               `db:"name" json:"name" description:"车辆名称"`
	TypeId         int64                `db:"type_id" json:"typeId" description:"车辆类别"`
	TypeName       string               `db:"tyoe_name" json:"typeName" description:"车辆类别名称"`
	Photo          []string             `db:"photo" json:"photo" description:"车辆照片地址"`
	DeviceId       int64                `db:"device_id" json:"deviceId" description:"设备id"`
	OwnerId        int64                `db:"owner_id" json:"ownerId" description:"车主id"`
	FleetId        int64                `db:"fleet_id" json:"fleetId" description:"所属车队id"`
	Status         int64                `db:"status" json:"status" description:"状态：0正常1确认中2未加入车队"`
	DateCreated    t.TimeMillisecond    `db:"date_created" description:"记录创建时间"`
	LastUpdated    t.TimeMillisecond    `db:"last_updated" description:"记录最后修改时间"`
}

type VehicleOwner struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
	Name           string               `db:"name" json:"name" description:"车主名称"`
	Mobile         string               `db:"mobile" json:"mobile" description:"车主手机号码"`
	Ids            string               `db:"ids" json:"ids" description:"车主身份证号码"`
	Addr           string               `db:"addr" json:"addr" description:"车主住址"`
	DateCreated    t.TimeMillisecond    `db:"date_created" description:"记录创建时间"`
	LastUpdated    t.TimeMillisecond    `db:"last_updated" description:"记录最后修改时间"`
}

type Fleet struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
	Name           string               `db:"name" json:"name" description:"车队名称"`
	PId            int64                `db:"p_id" json:"pId" description:"上级车队id"`
	MgrId          int64                `db:"mgr_id" json:"mgrId" description:"车队管理员id"`
	DateCreated    t.TimeMillisecond    `db:"date_created" description:"记录创建时间"`
	LastUpdated    t.TimeMillisecond    `db:"last_updated" description:"记录最后修改时间"`
}

type FleetCommand struct {
	Name           string               `db:"name" json:"name" description:"车队名称"`
	PId            int64                `db:"p_id" json:"pId" description:"上级车队id"`
	MgrId          int64                `db:"mgr_id" json:"mgrId" description:"车队管理员id"`
}

type FleetUpdateCommand struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
	Name           string               `db:"name" json:"name" description:"车队名称"`
	PId            int64                `db:"p_id" json:"pId" description:"上级车队id"`
}

type SearchFleetCommand struct {
	WhereSql         []byte  `description:"检索过滤条件"`
}

type DeleteFleetCommand struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
}

type VehicleCommand struct {
	Name           string               `db:"name" json:"name" description:"车辆名称"`
	TypeId         int64                `db:"type_id" json:"typeId" description:"车辆类别"`
	TypeName       string               `db:"tyoe_name" json:"typeName" description:"车辆类别名称"`
	Photo          []string             `db:"photo" json:"photo" description:"车辆照片地址"`
	DeviceId       int64                `db:"device_id" json:"deviceId" description:"设备id"`
	OwnerId        int64                `db:"owner_id" json:"ownerId" description:"车主id"`
	FleetId        int64                `db:"fleet_id" json:"fleetId" description:"所属车队id"`
	Status         int64                `db:"status" json:"status" description:"状态：0正常1确认中2未加入车队"`
}

type VehicleUpdateCommand struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
	Name           string               `db:"name" json:"name" description:"车辆名称"`
	TypeId         int64                `db:"type_id" json:"typeId" description:"车辆类别"`
	TypeName       string               `db:"tyoe_name" json:"typeName" description:"车辆类别名称"`
	Photo          []string             `db:"photo" json:"photo" description:"车辆照片地址"`
	DeviceId       int64                `db:"device_id" json:"deviceId" description:"设备id"`
	OwnerId        int64                `db:"owner_id" json:"ownerId" description:"车主id"`
	FleetId        int64                `db:"fleet_id" json:"fleetId" description:"所属车队id"`
	Status         int64                `db:"status" json:"status" description:"状态：0正常1确认中2未加入车队"`
}

type SearchVehicleCommand struct {
	WhereSql         []byte  `description:"检索过滤条件"`
}

type DeleteVehicleCommand struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
}

type FleetOfVehicleCommand struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
}


type FleetReturnInfo struct {
	ReturnInfo
	Data         []Fleet
}

type VehicleReturnInfo struct {
	ReturnInfo
	Data         []Vehicle
}

type FleetOfVehicle struct {
	Id             int64                `db:"id" json:"id" description:"主键"`
	Name           string               `db:"name" json:"name" description:"车队名称"`
	SubFleet       []FleetOfVehicle     `db:"sub_fleet" json:"subFleet" description:"子车队名称"`

}

type FleetOfVehicleReturnInfo struct {
	ReturnInfo
	Data         []FleetOfVehicle
}